// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from "vue";
import App from "./App";
import router from "./router";
import ElementUI from "element-ui";
import store from "./store";
import "element-ui/lib/theme-chalk/index.css";
import request from "@/api/request";
import echarts from "echarts";
import SlideVerify from "vue-monoplasty-slide-verify";

import { HappyScroll } from "vue-happy-scroll";
//自定义组件名
Vue.component("happy-scroll", HappyScroll);
import tagView from "@/views/index/comp/tag.vue";
Vue.component("tag-view", tagView);

import infoNumber from "@/components/infoNumber.vue";
Vue.component("info-number", infoNumber);

// 引入css
import "vue-happy-scroll/docs/happy-scroll.css";
import vuescroll from "vuescroll";
import "vuescroll/dist/vuescroll.css";
Vue.use(vuescroll);

import VueCropper from "vue-cropper";
Vue.use(VueCropper);

// // 全局中引入 main.js
// https://blog.csdn.net/HouMengFei_/article/details/124705408
import clipboard from "clipboard";
Vue.prototype.$clipboard = clipboard;
import msgBox from "@/components/instance/messageBox/index.js";
Vue.use(msgBox);

import hevueImgPreview from "hevue-img-preview";
Vue.use(hevueImgPreview);

import { VueJsonp } from "vue-jsonp";
Vue.use(VueJsonp);
Vue.use(SlideVerify);
Vue.prototype.$echarts = echarts;

import mixin from "./views/mixin.js";
Vue.mixin(mixin);
Vue.prototype.$store = store;

import time from "@/utils/dateTimePicker";
Vue.prototype.$time = time;

import util from "@/utils/util";
Vue.prototype.$util = util;
import {recover,recoverNotNull} from "@/utils/other";
Vue.prototype.recover = recover;
Vue.prototype.recoverNotNull = recoverNotNull;

// 引入
import secondHead from "@/views/index/comp/second-head";
Vue.component("secondHead", secondHead);
import dh from "@/views/index/comp/download-head";
Vue.component("downloadAppBtn", dh);
import packUpText2 from "@/views/index/comp/packUpText2.vue";
Vue.component("pack-up-text2", packUpText2);
import upload3 from '@/views/invite/comp/myupload/upload3.vue';
Vue.component("myUpload", upload3);

// 用户身份
import userLabel from "@/views/invite/comp/user-label.vue";
Vue.component("userLabel", userLabel);

Vue.config.productionTip = false;

Vue.prototype.$bus = new Vue();
Vue.use(ElementUI);
Vue.use(request);
new Vue({
  el: "#app",
  router,
  store,
  components: {
    App
  },
  template: "<App/>"
});
Vue.prototype.defaultAvatar =
  "https://pic.bangbangtongcheng.com/static/my/header.png";

Vue.prototype.$imgSuffixArr = [".jpg", ".png", ".jpeg", ".gif"];
Vue.prototype.$videoSuffixArr = [
  ".mp4",
  ".flv",
  ".avi",
  ".mpg",
  ".wmv",
  ".3gp",
  ".mov",
  ".asf",
  ".asx",
  ".vob",
  ".wmv9",
  ".rm",
  ".rmvb"
];
Vue.prototype.$imgAvideo = [
  ".jpg",
  ".png",
  ".jpeg",
  ".gif",
  ".mp4",
  ".flv",
  ".avi",
  ".mpg",
  ".wmv",
  ".3gp",
  ".mov",
  ".asf",
  ".asx",
  ".vob",
  ".wmv9",
  ".rm",
  ".rmvb"
];

Vue.prototype.$colors = [
  {
    bgColor: "#E9EFEF",
    wordColor: "#60807D",
    lineColor: "#B6C4C3",
    level: "青铜会员"
  },
  {
    bgColor: "#F7F7F7",
    wordColor: "#A3AAB0",
    lineColor: "#D2D9E0",
    level: "白银会员"
  },
  {
    bgColor: "#FFF8DE",
    wordColor: "#CEAB21",
    lineColor: "#D3CAB2",
    level: "黄金会员"
  },
  {
    bgColor: "#EDFAFF",
    wordColor: "#59B0E6",
    lineColor: "#BBD0DB",
    level: "铂金会员"
  },
  {
    bgColor: "#F2F5FF",
    wordColor: "#284EB6",
    lineColor: "#C1CBEF",
    level: "钻石会员"
  },
  {
    bgColor: "#FDF7FF",
    wordColor: "#A877C6",
    lineColor: "#DBC6E8",
    level: "钻石Ⅰ会员"
  },
  {
    bgColor: "#F8F2FF",
    wordColor: "#78439F",
    lineColor: "#958AC3",
    level: "钻石Ⅱ会员"
  },
  {
    bgColor: "#F4F2F2",
    wordColor: "#8D4581",
    lineColor: "#907B8C",
    level: "钻石Ⅲ会员"
  },
  {
    bgColor: "#F4F2F2",
    wordColor: "#502E30",
    lineColor: "#795D5E",
    level: "王者会员"
  }
];

function isMobile() {
  var userAgentInfo = navigator.userAgent;
  return /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(userAgentInfo);
}

if (isMobile()) {
  // console.log("这是手机访问");
  window.location.href = 'https://www.bangbangtongcheng.com/conven_web/#/';
}
